<?php

Loader::using("ext::libs::restful::RESTfulClient");
Loader::using("Models::Entities::Buques");

/**
 * Description of BuquesService
 *
 * @author JeyDotC
 */
class BuquesService extends RESTfulClient {

    public function Listar($skip, $range) {
        $result = $this->call("/$skip/$range", "GET");
        return $this->getDeserializer()->deserialize("Buques", $result);
    }

    public function GetAll() {
        $result = $this->call("/", "GET");
        return $this->getDeserializer()->deserialize("Buques", $result);
    }

    public function GetById($id) {
        $result = $this->call("/$id", "GET");
        return $this->getDeserializer()->deserialize("Buques", $result);
    }

    public function Create(Buques $buque) {
        $serializer = $this->getSerializer();
        $data = $serializer->serialize($buque);
        $result = $this->call("/", "POST", $data);
        return $this->getDeserializer()->deserialize("Buques", $result);
    }

    public function Update(Buques $buque) {
        $serializer = $this->getSerializer();
        $data = $serializer->serialize($buque);
        return $this->call("/", "PUT", $data);
    }

    public function Remove($id) {
        return $this->call("/$id", "DELETE");
    }

    function GetEliminados() {
        $result = $this->call("/Eliminados");
        return $this->getDeserializer()->deserialize("Buques", $result);
    }

    function Restaurar($id) {
        return $this->call("/Restaurar/$id");
    }

}

?>
